As a way of differentiating object-oriented computer programming from function-based programming, the former is a method of structuring programs so that a particular type of data and the parts of a program that operate on the data are combined. The latter is characterized by the use of functions that receive control of the computer processing when called and operate on data passed to them. Thus, objects are represented by both facts about them and the functions that process these facts.
Another approach to programming is rule-based programming, in which rules define premise-action pairs. Actions are carried out when data exist that meet the condition specified in the premise. Like functions, rules operate on data, but are triggered when certain data exist rather than being called by another part of a program. Rule-based programming is especially useful for applications that must determine what action to take, based on certain facts.
Existing rule-based application programs are developed from stand-alone rules systems, and reason on the basis of internally defined data structures. The programmer is constrained to use the data structures provided by the rules system. Data derived externally from the rule system must be reformatted into a format specified by the rule system before it can be evaluated by the rule system.
One method of using a rule system with object-oriented programming is to reformat and copy the data structures of the object-oriented program to the data structures of the rule system. The disadvantage of this method is the cost in terms of time and memory.
It would be advantageous if programmers could develop a problem domain using general and standard object-oriented programming languages, and then develop rules to inference from that domain. Ideally, the rules could be directly coupled to an object-oriented application program, and the need to modify the application program would be minimal.